package cn.lysj.framework.common.validate.entity;

import java.lang.reflect.Field;
import java.util.Arrays;

public class Medusa {
    private boolean flag; //校验结果
    private Field field; //参数
    private String message; //校验提示
    private boolean sort; //提示信息的排序
    private Class<?>[] groups; //校验的组别

    public Medusa() {}

    public Medusa(boolean flag) {
        this.flag = flag;
    }

    public Medusa(boolean flag, Field field, String message) {
        this.flag = flag;
        this.field = field;
        this.message = message;
    }

    public Medusa(boolean flag, Field field, String message, boolean sort) {
        this.flag = flag;
        this.field = field;
        this.message = message;
        this.sort = sort;
    }

    public Medusa(boolean flag, Field field, String message, boolean sort, Class<?>[] groups) {
        this.flag = flag;
        this.field = field;
        this.message = message;
        this.sort = sort;
        this.groups = groups;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public Field getField() {
        return field;
    }

    public void setField(Field field) {
        this.field = field;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSort() {
        return sort;
    }

    public void setSort(boolean sort) {
        this.sort = sort;
    }

    public Class<?>[] getGroups() {
        return groups;
    }

    public void setGroups(Class<?>[] groups) {
        this.groups = groups;
    }

    @Override
    public String toString() {
        return "Medusa{" +
                "flag=" + flag +
                ", field=" + field +
                ", message='" + message + '\'' +
                ", sort=" + sort +
                ", groups=" + Arrays.toString(groups) +
                '}';
    }
}
